package com.util;

import com.config.WebConfig;
import com.hdb.TGood;

/**
 * Created by aszer on 2016/11/7.
 */
public class OrderItem {
    private int count;
    private TGood good;

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        if (count > WebConfig.MaxGoodOrderCount) {
            count = WebConfig.MaxGoodOrderCount;
        }
        this.count = count;
    }

    public TGood getGood() {
        return good;
    }

    public OrderItem(TGood good, int count) {
        this.good = good;
        this.count = count;

    }

    public void addCount(int count) {
        setCount(getCount() + count);
    }
}
